package com.sg.controller.bff;

import com.sg.service.biz.bff.PositionService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Position", tags = {"Position"})
@RestController
// @RequestMapping("/oms/position/")
public class PositionController {

    @Autowired
    PositionService positionService;

    /**
     * B1-3查询职务详情(边界)
     * gen by moon at 8/18/2022, 10:21:52 PM
     */
    @PostMapping("/oms/position/queryPositionDetail")
    @ApiOperation(value = "B1-3查询职务详情(边界)", response = OkrResult.class)
    public OkrResult<BffQueryPositionDetailRespDto> queryPositionDetail(@RequestBody(required = false) @Validated BffQueryPositionDetailReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionDetail(reqDTO));
    }

    /**
     * B1-3编制去重职务列表（边界）
     * gen by moon at 8/10/2022, 3:37:28 AM
     */
    @PostMapping("/oms/mgt/position/queryNoRepPositionList")
    @ApiOperation(value = "B1-3编制去重职务列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryNoRepPositionListRespDto> queryNoRepPositionList(@RequestBody(required = false) @Validated BffQueryNoRepPositionListReqDto reqDTO) {
        return OkrResult.success(positionService.queryNoRepPositionList(reqDTO));
    }

    /**
     * B1-3查询带编制统计组织职务列表（边界）
     * gen by moon at 8/10/2022, 3:37:26 AM
     */
    @PostMapping("/oms/mgt/position/queryOrgPositionStaffNumList")
    @ApiOperation(value = "B1-3查询带编制统计组织职务列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryOrgPositionStaffNumListRespDto> queryOrgPositionStaffNumList(@RequestBody(required = false) @Validated BffQueryOrgPositionStaffNumListReqDto reqDTO) {
        return OkrResult.success(positionService.queryOrgPositionStaffNumList(reqDTO));
    }

    /**
     * B1-3查询带编制统计职务列表（边界）
     * gen by moon at 8/10/2022, 3:37:18 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionStaffNumList")
    @ApiOperation(value = "B1-3查询带编制统计职务列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryPositionStaffNumListRespDto> queryPositionStaffNumList(@RequestBody(required = false) @Validated BffQueryPositionStaffNumListReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionStaffNumList(reqDTO));
    }

    /**
     * B1-3查询职务列表（边界）
     * gen by moon at 8/10/2022, 3:36:25 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionListBorder")
    @ApiOperation(value = "B1-3查询职务列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryPositionListBorderRespDto> queryPositionListBorder(@RequestBody(required = false) @Validated BffQueryPositionListBorderReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionListBorder(reqDTO));
    }

    /**
     * B1-3查询可存档职务条件（管理）
     * gen by moon at 8/10/2022, 3:35:53 AM
     */
    @PostMapping("/oms/mgt/position/queryArchivePosition")
    @ApiOperation(value = "B1-3查询可存档职务条件（管理）", response = OkrResult.class)
    public OkrResult<BffQueryArchivePositionRespDto> queryArchivePosition(@RequestBody(required = false) @Validated BffQueryArchivePositionReqDto reqDTO) {
        return OkrResult.success(positionService.queryArchivePosition(reqDTO));
    }

    /**
     * B1-3查询职务名称列表（边界）
     * gen by moon at 8/10/2022, 3:35:27 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionTitleListBorder")
    @ApiOperation(value = "B1-3查询职务名称列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryPositionTitleListBorderRespDto> queryPositionTitleListBorder(@RequestBody(required = false) @Validated BffQueryPositionTitleListBorderReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionTitleListBorder(reqDTO));
    }

    /**
     * B1-3查询职务名称详情(管理）
     * gen by moon at 8/10/2022, 3:34:28 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionTitleDetail")
    @ApiOperation(value = "B1-3查询职务名称详情(管理）", response = OkrResult.class)
    public OkrResult<BffQueryPositionTitleDetailRespDto> queryPositionTitleDetail(@RequestBody(required = false) @Validated BffQueryPositionTitleDetailReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionTitleDetail(reqDTO));
    }

    /**
     * B1-3查询职务名称列表(管理）
     * gen by moon at 8/10/2022, 3:34:26 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionTitleList")
    @ApiOperation(value = "B1-3查询职务名称列表(管理）", response = OkrResult.class)
    public OkrResult<BffQueryPositionTitleListRespDto> queryPositionTitleList(@RequestBody(required = false) @Validated BffQueryPositionTitleListReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionTitleList(reqDTO));
    }

    /**
     * B1-3查询可存档职务名称条件(管理）
     * gen by moon at 8/10/2022, 3:34:24 AM
     */
    @PostMapping("/oms/mgt/position/queryArchivePositionTitle")
    @ApiOperation(value = "B1-3查询可存档职务名称条件(管理）", response = OkrResult.class)
    public OkrResult<BffQueryArchivePositionTitleRespDto> queryArchivePositionTitle(@RequestBody(required = false) @Validated BffQueryArchivePositionTitleReqDto reqDTO) {
        return OkrResult.success(positionService.queryArchivePositionTitle(reqDTO));
    }

    /**
     * B1-3修改职务名称(管理）
     * gen by moon at 8/10/2022, 3:34:22 AM
     */
    @PostMapping("/oms/mgt/position/updatePositionTitle")
    @ApiOperation(value = "B1-3修改职务名称(管理）", response = OkrResult.class)
    public OkrResult<BffUpdatePositionTitleRespDto> updatePositionTitle(@RequestBody(required = false) @Validated BffUpdatePositionTitleReqDto reqDTO) {
        return OkrResult.success(positionService.updatePositionTitle(reqDTO));
    }

    /**
     * B1-3新增职务名称(管理）
     * gen by moon at 8/10/2022, 3:34:20 AM
     */
    @PostMapping("/oms/mgt/position/addPositionTitle")
    @ApiOperation(value = "B1-3新增职务名称(管理）", response = OkrResult.class)
    public OkrResult<BffAddPositionTitleRespDto> addPositionTitle(@RequestBody(required = false) @Validated BffAddPositionTitleReqDto reqDTO) {
        return OkrResult.success(positionService.addPositionTitle(reqDTO));
    }

    /**
     * B1-3存档职务（管理）
     */
    @PostMapping("/oms/mgt/position/archivePosition")
    @ApiOperation(value = "B1-3存档职务（管理）", response = OkrResult.class)
    public OkrResult<BffArchivePositionRespDto> archivePosition(@RequestBody(required = false) @Validated BffArchivePositionReqDto reqDTO) {
        return OkrResult.success(positionService.archivePosition(reqDTO));
    }

    /**
     * B1-3-修改职务
     * gen by moon at 8/10/2022, 3:31:05 AM
     */
    @PostMapping("/oms/mgt/position/updatePosition")
    @ApiOperation(value = "B1-3-修改职务", response = OkrResult.class)
    public OkrResult<BffUpdatePositionRespDto> updatePosition(@RequestBody(required = false) @Validated BffUpdatePositionReqDto reqDTO) {
        return OkrResult.success(positionService.updatePosition(reqDTO));
    }

    /**
     * B1-3-新增职务（管理）
     * gen by moon at 9/27/2022, 9:36:46 AM
     */
    @PostMapping("/oms/mgt/position/addPosition")
    @ApiOperation(value = "B1-3-新增职务（管理）", response = OkrResult.class)
    public OkrResult<BffAddPositionRespDto> addPosition(@RequestBody(required = false) @Validated BffAddPositionReqDto reqDTO) {
        return OkrResult.success(positionService.addPosition(reqDTO));
    }

    /**
     * B1-3查询职务列表（管理）
     * gen by moon at 8/10/2022, 3:30:32 AM
     */
    @PostMapping("/oms/mgt/position/queryPositionList")
    @ApiOperation(value = "B1-3查询职务列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPositionListRespDto> queryPositionList(@RequestBody(required = false) @Validated BffQueryPositionListReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionList(reqDTO));
    }

    /**
     * B1-3批量更新职务（管理）
     * gen by moon at 8/10/2022, 3:35:30 AM
     */
    @PostMapping("/oms/mgt/position/batchUpdatePosition")
    @ApiOperation(value = "B1-3批量更新职务（管理）", response = OkrResult.class)
    public OkrResult<BffBatchUpdatePositionRespDto> batchUpdatePosition(@RequestBody(required = false) @Validated BffBatchUpdatePositionReqDto reqDTO) {
        return OkrResult.success(positionService.batchUpdatePosition(reqDTO));
    }

    /**
     * B1-3查询管理模式职务详情(管理)
     * gen by moon at 8/20/2022, 5:59:37 PM
     */
    @PostMapping("/oms/mgt/position/queryPositionMgtDetail")
    @ApiOperation(value = "B1-3查询管理模式职务详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryPositionMgtDetailRespDto> queryPositionMgtDetail(@RequestBody(required = false) @Validated BffQueryPositionMgtDetailReqDto reqDTO) {
        return OkrResult.success(positionService.queryPositionMgtDetail(reqDTO));
    }
}
